cos
Cosine
cos()
function returns the cosine of a number.
In this case, we will calculate the cosines of different values:
<?php echo ( cos ( 3 ) ) ; echo ( cos ( - 3 ) ) ; echo ( cos ( 0 ) ) ; echo ( cos ( M_PI ) ) ; echo ( cos ( 2 * M_PI ) ) ; ?>
Try it yourself
cos ( x )
parameter | describe |
---|---|
x | Required. A number. |
cos()
returns the cosine value of the parameter x . The unit of parameter x is radians.